package com.yudean.esb.dao.mds;

import com.yudean.esb.domain.mds.MdsGlFlexValues;
import com.yudean.esb.mapper.mds.MdsGlFlexValuesMapper;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.List;

@Repository("mdsGlFlexValuesDao")
@Scope("prototype")
public class MdsGlFlexValuesDao {
    @Resource
    private MdsGlFlexValuesMapper mdsGlFlexValuesMapper;

    /**
     * @param rowStart
     * @param rowEnd
     * @return
     */
    public List<MdsGlFlexValues> getAllMdsGlFlexValues(int rowStart, int rowEnd) {

        List<MdsGlFlexValues> list = mdsGlFlexValuesMapper.getAllMdsGlFlexValues(rowStart, rowEnd);
        if (list == null || list.size() < 1) {
            return null;
        }
        return list;
    }

    public int getAllMdsGlFlexValuesCount() {
        return mdsGlFlexValuesMapper.getAllMdsGlFlexValuesCount();
    }

    /**
     * @param usedComps
     * @param flexValueSetName
     * @param rowStart
     * @param rowEnd
     * @return
     */
    public List<MdsGlFlexValues> getAllGLFlexValuesByUsedCompsAndFlexValueSetName(String usedComps, String flexValueSetName, int rowStart, int rowEnd) {
        List<MdsGlFlexValues> list = mdsGlFlexValuesMapper.getAllGLFlexValuesByUsedCompsAndFlexValueSetName(usedComps, flexValueSetName, rowStart, rowEnd);
        if (list == null || list.size() < 1) {
            return null;
        }
        return list;
    }

    /**
     * @param usedComps
     * @param flexValueSetName
     * @return
     */
    public int getAllGLFlexValuesCountByUsedCompsAndFlexValueSetName(String usedComps, String flexValueSetName) {
        return mdsGlFlexValuesMapper.getAllGLFlexValuesCountByUsedCompsAndFlexValueSetName(usedComps, flexValueSetName);
    }
}
